function SrvLimited(params){ 
	 
}

SrvLimited.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new SrvLimited.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new SrvLimited.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new SrvLimited.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	
	
	/** 编号 [非空]       **/
	this.slId=function(slId){if(this.proxy)return this.getProxy().slId(slId);  this.put("slId", slId);return this;};
	/** and sl_id is null */
	this.slIdNull=function(){if(this.proxy)return this.getProxy().slIdNull();if(this.get("slIdNot")==null)this.put("slIdNot", "");this.put("slId", null);return this;};
	/** not .... */
	this.slIdNot=function(){if(this.proxy)return this.getProxy().slIdNot();this.put("slIdNot", "not");return this;};
	this.slIdNotNull=function(){if(this.proxy)return this.getProxy().slIdNotNull();this.put("slIdNot", "not");this.put("slId", null);return this;};
	this.slIdNot=function(slId){if(this.proxy)return this.getProxy().slIdNot(slId);this.put("slIdNot", "not");this.put("slId", slId);return this;};
		
	/** and sl_id <= ? */
	this.slIdMin=function(min){if(this.proxy)return this.getProxy().slIdMin(min);this.put("slIdMin", min);return this;};
	/** and sl_id >= ? */
	this.slIdMax=function(max){if(this.proxy)return this.getProxy().slIdMax(max);this.put("slIdMax", max);return this;};
		
		
	this.slIdIn=function(ids){
		if(this.proxy)return this.getProxy().slIdIn(ids);  this.put("slIdIn", ids);return this;
	};	
		 
	
	
	/** 所属项目 [非空] [SrvProject]      **/
	this.slProject=function(slProject){if(this.proxy)return this.getProxy().slProject(slProject);  this.put("slProject", slProject);return this;};
	/** and sl_project is null */
	this.slProjectNull=function(){if(this.proxy)return this.getProxy().slProjectNull();if(this.get("slProjectNot")==null)this.put("slProjectNot", "");this.put("slProject", null);return this;};
	/** not .... */
	this.slProjectNot=function(){if(this.proxy)return this.getProxy().slProjectNot();this.put("slProjectNot", "not");return this;};
	this.slProjectNotNull=function(){if(this.proxy)return this.getProxy().slProjectNotNull();this.put("slProjectNot", "not");this.put("slProject", null);return this;};
	this.slProjectNot=function(slProject){if(this.proxy)return this.getProxy().slProjectNot(slProject);this.put("slProjectNot", "not");this.put("slProject", slProject);return this;};
		
		
	this.slProjectIn=function(ids){
		if(this.proxy)return this.getProxy().slProjectIn(ids);  this.put("slProjectIn", ids);return this;
	};	
		 
	
	
	/** 所属角色  [SrvGroup]      **/
	this.slGroup=function(slGroup){if(this.proxy)return this.getProxy().slGroup(slGroup);  this.put("slGroup", slGroup);return this;};
	/** and sl_group is null */
	this.slGroupNull=function(){if(this.proxy)return this.getProxy().slGroupNull();if(this.get("slGroupNot")==null)this.put("slGroupNot", "");this.put("slGroup", null);return this;};
	/** not .... */
	this.slGroupNot=function(){if(this.proxy)return this.getProxy().slGroupNot();this.put("slGroupNot", "not");return this;};
	this.slGroupNotNull=function(){if(this.proxy)return this.getProxy().slGroupNotNull();this.put("slGroupNot", "not");this.put("slGroup", null);return this;};
	this.slGroupNot=function(slGroup){if(this.proxy)return this.getProxy().slGroupNot(slGroup);this.put("slGroupNot", "not");this.put("slGroup", slGroup);return this;};
		
		
	this.slGroupIn=function(ids){
		if(this.proxy)return this.getProxy().slGroupIn(ids);  this.put("slGroupIn", ids);return this;
	};	
		 
	
	
	/** 权限值 [非空]       **/
	this.slLimit=function(slLimit){if(this.proxy)return this.getProxy().slLimit(slLimit);  this.put("slLimit", slLimit);return this;};
	/** and sl_limit is null */
	this.slLimitNull=function(){if(this.proxy)return this.getProxy().slLimitNull();if(this.get("slLimitNot")==null)this.put("slLimitNot", "");this.put("slLimit", null);return this;};
	/** not .... */
	this.slLimitNot=function(){if(this.proxy)return this.getProxy().slLimitNot();this.put("slLimitNot", "not");return this;};
	this.slLimitNotNull=function(){if(this.proxy)return this.getProxy().slLimitNotNull();this.put("slLimitNot", "not");this.put("slLimit", null);return this;};
	this.slLimitNot=function(slLimit){if(this.proxy)return this.getProxy().slLimitNot(slLimit);this.put("slLimitNot", "not");this.put("slLimit", slLimit);return this;};
		
		
	this.slLimitIn=function(ids){
		if(this.proxy)return this.getProxy().slLimitIn(ids);  this.put("slLimitIn", ids);return this;
	};	
		 
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有权限配置 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/permissions/limit.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取权限配置分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/permissions/limit.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取权限配置 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/permissions/limit.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

SrvLimited.get = function(id){
	var protocol = ux.ajax("/admin/permissions/limit.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.srvLimited;
	return null;
}

SrvLimited.where = new SrvLimited.Where(0,true);